package com.xwn.utils.utils;

import com.xwn.bean.system.ResponseBodyEntity;

/**
 *
 * @Author duandw
 * @Date 2019/11/5 15:27
 **/
public class ResultUtil {
    public static ResponseBodyEntity success() {
        return success(null);
    }

    public static ResponseBodyEntity success(Object object) {
        ResponseBodyEntity result = new ResponseBodyEntity();
        result.setCode(200);
        result.setMsg("成功");
        result.setData(object);
        return result;
    }

    public static ResponseBodyEntity error(Integer code, String msg) {
        ResponseBodyEntity result = new ResponseBodyEntity();
        result.setCode(code);
        result.setMsg(EnumUtil.getExceptionMsg(code,msg));
        return result;
    }
}
